1. Field of the Invention
The present invention relates to an imaging device, an image processing device, an image processing method, and a non-transitory computer readable medium. In particular, the present invention relates to a technique of detecting abnormal oblique incident light.
2. Description of the Related Art
Generally, in single-plate-type imaging elements having mosaic color filter arrays, color mixture is caused by light leakage from adjacent pixels. When an image is generated by performing digital signal processing on color signals of RGB colors which tend to be greatly affected by color mixture, color reproducibility (image quality) of the image is lowered, and it is difficult to accurately calculate a white balance (WB) gain for WB correction from the color signals of RGB colors which tend to be greatly affected by color mixture.
If light with strong intensity is incident into a lens when a subject image is captured by an imaging device such as a digital camera, light reflected from surfaces of a photography lens, microlenses, and the like is reflected along complex paths inside the lenses or inside the camera. As a result, the imaging element may receive light which travels at an undesired angle. As described above, abnormal oblique incident light, which is incident into the imaging element at the undesired angle, causes phenomena such as so-called ghosts and flares, and thus deteriorates image quality of a captured image.
In particular, if an incident angle of the abnormal oblique incident light is large, in some cases, pixels constituted of color filters onto which abnormal oblique incident light is incident may not correspond to pixels constituted of photodiodes in which abnormal oblique incident light is received. If color filters through which abnormal oblique incident light passes do not perfectly correspond to photodiodes in which abnormal oblique incident light is actually received, a color mixture phenomenon occurs. As a result, the phenomenon causes deterioration in color reproducibility of a captured image. The color mixture phenomenon tends to be caused by abnormal oblique incident light including particularly long-wavelength components (for example, a red light component).
As a method for reducing an effect of the color mixture, there is proposed a technique of detecting locations where ghosts and the like occur and correcting output differences (level differences) in pixel data between pixels. For example, JP2012-009919A discloses a technique of detecting whether or not there is a level difference by calculating an average pixel value of Gr/Gb for each predetermined area and counting comparative accumulated values such as a threshold value and a relative difference value, in a Bayer array.
Further, JP2005-333251A discloses a technique of detecting noise in units of MCU (8 lines×16 pixels) by using a reference pattern, in the Bayer array. According to the technique of JP2005-333251A, reference patterns 100P (5×5 pixels) for color noise determination are held, and color noise is detected on the basis of whether or not it matches with the reference patterns 100P.
Furthermore, JP2008-054206A discloses a technique of dividing an image area in units of blocks, specifying positions of blocks in which ghosts are detected, and performing ghost correction.